
package cn.blankm.video.surface;

import android.graphics.Bitmap;
import android.view.View;

import androidx.annotation.Keep;
import androidx.annotation.NonNull;
import cn.blankm.videokernel.inter.AbstractVideoPlayer;


/**
 * Copyright (C), 1999-2022
 * Author qfmeng@iflytek.com
 * Date 2022/5/26 16:40
 *
 * Description: 自定义渲染view接口
 */
@Keep
public interface InterSurfaceView {

    /**
     * 关联AbstractPlayer
     *
     * @param player player
     */
    void attachToPlayer(@NonNull AbstractVideoPlayer player);

    /**
     * Surface 状态变化回调
     * @param surfaceListener 回调事件
     */
    void setSurfaceListener(ISurfaceListener surfaceListener);

    /**
     * 设置视频宽高
     *
     * @param videoWidth  宽
     * @param videoHeight 高
     */
    void setVideoSize(int videoWidth, int videoHeight);

    /**
     * 设置视频旋转角度
     *
     * @param degree 角度值
     */
    void setVideoRotation(int degree);

    /**
     * 设置screen scale type
     *
     * @param scaleType 类型
     */
    void setScaleType(int scaleType);

    /**
     * 获取真实的RenderView
     *
     * @return view
     */
    View getView();

    /**
     * 截图
     *
     * @return bitmap
     */
    Bitmap doScreenShot();

    /**
     * 释放资源
     */
    void release();

}